package com.haizhi.bean;

// Generated 2016-8-15 17:44:37 by Hibernate Tools 3.2.2.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity: 
 */
@Entity
@Table(name = "tb_comment", catalog = "db_lemon3d")
public class TbComment implements java.io.Serializable {

	/** 
	 * ����id.
	 */

	private Integer commentId;

	/** 
	 * �û�id.
	 */

	private TbUser tbUser;

	/** 
	 * ��Ʒid.
	 */

	private TbProduct tbProduct;

	/** 
	 * ��������, 1Ϊ��ͨ���ۣ�2Ϊ�������ۣ�-1��-2Ϊ��Ӧ����.
	 */

	private int commentType;

	/** 
	 * �������ݣ���������Ϊģ�����ݣ��ϳ�.
	 */

	private String commentContent;

	/** 
	 * ����ʱ��.
	 */

	private Date commentTime;

	/** 
	 * ������ţ���1��ʼ.
	 */

	private int commentFloors;

	public TbComment() {
	}

	public TbComment(TbUser tbUser, TbProduct tbProduct, int commentType,
			String commentContent, Date commentTime, int commentFloors) {
		setTbUser(tbUser);
		setTbProduct(tbProduct);
		setCommentType(commentType);
		setCommentContent(commentContent);
		setCommentTime(commentTime);
		setCommentFloors(commentFloors);
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "comment_id", unique = true, nullable = false)
	public Integer getCommentId() {
		return this.commentId;
	}

	public void setCommentId(Integer commentId) {
		this.commentId = commentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public TbUser getTbUser() {
		return this.tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "product_id", nullable = false)
	public TbProduct getTbProduct() {
		return this.tbProduct;
	}

	public void setTbProduct(TbProduct tbProduct) {
		this.tbProduct = tbProduct;
	}

	@Column(name = "comment_type", nullable = false)
	public int getCommentType() {
		return this.commentType;
	}

	public void setCommentType(int commentType) {
		this.commentType = commentType;
	}

	@Column(name = "comment_content", nullable = false, length = 65535)
	public String getCommentContent() {
		return this.commentContent;
	}

	public void setCommentContent(String commentContent) {
		this.commentContent = commentContent;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "comment_time", nullable = false, length = 19)
	public Date getCommentTime() {
		return this.commentTime;
	}

	public void setCommentTime(Date commentTime) {
		this.commentTime = commentTime;
	}

	@Column(name = "comment_floors", nullable = false)
	public int getCommentFloors() {
		return this.commentFloors;
	}

	public void setCommentFloors(int commentFloors) {
		this.commentFloors = commentFloors;
	}

}
